a = int(input("范围 "))


def xxx(num):
    if num < 1:
        return False
    b = sum(i for i in range(1, num) if num % i == 0)
    return b == num


for i in range(1, a):
    if xxx(i):
        print(i)
